package com.cwj.thread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author chenwujie
 * @date 2020-12-31 14:10
 */
public class ThreadPoolTest {
    public static void main(String[] args) {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(
                0,
                Integer.MAX_VALUE,
                60,
                TimeUnit.SECONDS,
                new SynchronousQueue<>()
        );
        executor.execute(() -> System.out.println("aaa"));
        executor.execute(() -> System.out.println("bbb"));
        executor.execute(() -> System.out.println("ccc"));

    }

}
